<?php
/**
 * Created by PhpStorm.
 * User: Duyonggao
 * Date: 2017/7/4 0004
 * Time: 下午 4:40
 */

namespace app\commands;


use yii\console\Controller;
use utils\Curl;

class getController extends Controller
{
    public function actionIndex(){
        $curl = new Curl();
        $curl->setBasicAuthentication('username', 'password');
        $curl->setUserAgent('Mozilla/5.0 (Linux; U; Android 4.4.4; zh-cn; HTC D820u Build/KTU84P) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 SogouMSE,SogouMobileBrowser/3.5.1');
        $curl->setReferrer('http://www.qingtaoke.com/');
        $content = $curl->get('http://www.qingtaoke.com/qingwangzhan');
        return $content;
    }
}